/**
 * Copyright (C) 2012 The SkyTvOS Project
 *
 * Version     Date           Author
 * ─────────────────────────────────────
 *           2016-1-28         yellowlgx
 *
 */

package com.skyworth.ui.blurbg;

import android.animation.Animator;
import android.annotation.SuppressLint;
import android.view.View;

/**
 * @ClassName AnimationEndListener
 * @author yellowlgx
 * @date 2016-1-28
 */
@SuppressLint("InlinedApi")
public class AnimationEndListener implements Animator.AnimatorListener
{
    private View mView;

    public AnimationEndListener(View v)
    {
        mView = v;
    }

    @Override
    public void onAnimationStart(Animator animation)
    {
        mView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
    }

    @Override
    public void onAnimationEnd(Animator animation)
    {
        mView.setLayerType(View.LAYER_TYPE_NONE, null);
    }

    @Override
    public void onAnimationCancel(Animator animation)
    {
        mView.setLayerType(View.LAYER_TYPE_NONE, null);
    }

    @Override
    public void onAnimationRepeat(Animator animation)
    {

    }
}
